package com.beijing.springbootclustersession.config;

import com.beijing.springbootclustersession.interceptor.SessionInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;
import org.springframework.web.servlet.view.json.MappingJackson2JsonView;

/**
 * @Authther: mrwu
 * @date:2021/4/1-04
 * @Description:com.beijing.springbootclustersession.config
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //将自定义拦截器注册进拦截器配置中 添加匹配规则，排除login页面
        registry.addInterceptor(new SessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/login/**");
    }
}
